#include <stdio.h>
void bubble(int *data,int count){
int i,j;
int *p,*q;
p=data,q=data+1;
for(j=1;j<count;j++)
{//	p=data;
//	q=data+1;
	for(i=j-1;i>=0;i--)
	if(*q>*p)
	{int t=*q;
	*q=*p;
	*p=t;}
}
}

int main(void){
int count,i,a[20];
printf("How many numbers do you want to sort?\n");
scanf("%d",&count);
printf("Please input these numbers:\n");
for(i=0;i<count;i++)
{scanf("%d",&a[i]);}
bubble(a,count);
printf("The sort result is:\n");
for(i=0;i<count;i++)
{printf("%4d",a[i]);}
printf("\n");
}
